home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 20 / 020.d81 / math facts (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  7KB  |  213 lines

  1. 50 gosub60000:printchr$(142)
  2. 100 print"[147]":poke53280,0:poke53281,14
  3. 101 print"[144] type your first name"
  4. 102 input" then press <return> ";n$
  5. 103 print"[147][144]":printtab(9)"";n$;", do you want to"
  6. 104 print" add, subtract, multiply, or divide.":pn=0:nr=0:nw=0:gr=0:a=(-ti)
  7. 105 print"[144]                                        [146]"
  8. 106 print"   [150]                                 [146]
  9. 107 [153]"   def  stop a  press for addition       def  wait"
  10. 108 a$[178]"   def                                 wait":[153]a$
  11. 109 [153]"   def  stop s  press for subtraction    def  wait"
  12. 110 [153]a$
  13. 111 [153]"   def  stop m  press for multiplication def  wait"
  14. 112 [153]a$
  15. 113 [153]"   def  stop d  press for division       def  wait":[153]a$
  16. 114 [153]"   def  stop q  press to exit            def  wait"
  17. 115 [153]"   def                                 wait
  18. 116 get an$:if an$="" then 116
  19. 117 if an$="q" then goto 63000
  20. 118 if an$="a" then goto 125
  21. 119 if an$="s" then goto 126
  22. 120 if an$="m" then goto 127
  23. 121 if an$="d" then goto 128
  24. 122 goto 116
  25. 125 as$="+":gosub3000:goto197
  26. 126 as$="-":gosub3000:goto197
  27. 127 as$="x":gosub3000:goto197
  28. 128 as$="%":gosub3000:goto197
  29. 130 gosub 3400:goto197
  30. 132 gosub 3042
  31. 197 print"[147]":poke53280,0:poke53281,14
  32. 198 printtab(5)"[144]press [158] q [146] [144]to change operations"
  33. 199 print"[144]                                        [146]";
  34. 200 printtab(50)"[144][181]";tab(60)"[144][181]";tab(70)"[144][181]"
  35. 201 printtab(1)"problem";tab(12)"number";tab(22);"number";tab(32)"your"
  36. 202 printtab(1)"number";tab(12)"right";tab(22);"wrong";tab(32)"score"
  37. 203 printtab(3)"[158]";pn;tab(13)nr;tab(24);nw;tab(32)gr
  38. 204 print"[144]                                        [146][145][145][145][145][145][145]";
  39. 206 fory=1to5:printtab(10)"[144][181]";tab(20)"[144][181]";tab(30)"[144][181]":next y
  40. 212 printtab(10)"                 [146]":pn=pn+1
  41. 213 printtab(10)" [150]                [146]"
  42. 214 printtab(10)" [150]                [146]"
  43. 215 printtab(10)" [150]                [146]"
  44. 220 printtab(10)"                 [146]"
  45. 225 if an$="a" or an$="m" then goto231
  46. 230 printtab(15)"[145][145][145][144]";a2;"[157] ";as$;b1;"[157] ":goto235
  47. 231 printtab(15)"[145][145][145][144]";b1;"[157] ";as$;a2;"[157] "
  48. 235 input"               ";c$:c2=val(c$)
  49. 237 if c$="q" then goto 103
  50. 240 if c2=d then gosub 2200
  51. 245 if c2<>d then gosub 2100
  52. 247 gr=int((nr/(nr+nw))*100)
  53. 250 if y$="q" then goto 130
  54. 255 goto 132
  55. 2099 goto2199: rem go to the end of program
  56. 2100 print"[147]":poke53281,0:poke53280,0
  57. 2130 printtab(4)"[145][169]               [223][146]"
  58. 2131 printtab(3)"[169]                 [223][146]"
  59. 2132 printtab(2)"[169]  [146][169]             [223]  [223][146]"
  60. 2133 printtab(2)"  [146][169]               [223]  [146]"
  61. 2134 printtab(2)" [146][169]  [162][162][162][162]     [162][162][162][162]  [223] [146]"
  62. 2136 printtab(2)"[169]   [175][175][175][175]     [175][175][175][175]   [223]"
  63. 2138 printtab(2)"[180]   [180][149][213][201][170] [180] [170] [180][149][213][201][170]   [170]"
  64. 2140 printtab(0)"[213][192][180]   [180][149][202][203][170] [180] [170] [180][149][202][203][170]   [170][192][201]"
  65. 2142 printtab(0)"[221] [180]   [183][183][183][183] [180] [170] [183][183][183][183]   [170] [221]"
  66. 2144 printtab(0)"[221] [180]   [205]    [180] [170]    [206]   [170] [221]"
  67. 2146 printtab(0)"[221] [180]   [170]   [206]   [205]   [180]   [170] [221]"
  68. 2148 printtab(0)"[202][192][180]   [170]   [180]   [170]   [180]   [170][192][203]"
  69. 2150 printtab(2)"[205]       [163][163][163][163][163]       [206]"
  70. 2152 printtab(3)"[205]                 [206]   ";n$
  71. 2154 printtab(4)"[205]     [150][206][184][184][184][205]     [206]  i am sorry"
  72. 2156 printtab(5)"[205]    [150][184][184][184][184][184]    [206]      but "
  73. 2158 printtab(6)"[202][192][192]       [192][192][203]  "
  74. 2159 if an$="a" or an$="m" then goto 2161
  75. 2160 printtab(6)"   [205][175][175][175][175][175][206]     ";a2;as$;b1;"is not ";c$;"":goto 2162
  76. 2161 printtab(6)"   [205][175][175][175][175][175][206]     ";b1;as$;a2;"is not ";c$;""
  77. 2162 nw=nw+1
  78. 2165 gosub 4000
  79. 2190 gosub 9000
  80. 2191 n2=n2+1:if n2>16 then n2=0
  81. 2192 return
  82. 2199 load"hello connect",8
  83. 2200 print"[147]":poke53280,n1:poke53281,0
  84. 2210 x=int(6*rnd(0)+1)
  85. 2211 if x = 1 then goto 2221
  86. 2212 if x = 2 then goto 2222
  87. 2213 if x = 3 then goto 2223
  88. 2214 if x = 4 then goto 2224
  89. 2215 if x = 5 then goto 2225
  90. 2216 if x = 6 then goto 2226
  91. 2221 printtab(14)"great, ";n$:goto2230
  92. 2222 printtab(12)"good work, ";n$:goto2230
  93. 2223 printtab(13)"correct, ";n$:goto2230
  94. 2224 printtab(10)n$;", you are smart":goto2230
  95. 2225 printtab(4)n$;", you're ready to graduate.":goto2230
  96. 2226 printtab(10)n$;", you're good":goto2230
  97. 2230 printtab(12)"[158][169]               [223][146]"
  98. 2231 printtab(11)"[158][169]                 [223][146]"
  99. 2232 printtab(10)"[158][169]  [146][169]             [223]  [223][146]"
  100. 2233 printtab(9)"[158][169]  [146][169]               [223]  [223][146]"
  101. 2234 printtab(9)"[158]  [146][169]  [162][162][162][162]     [162][162][162][162]  [223]  [146]"
  102. 2236 printtab(9)"[158] [146][169]   [175][175][175][175]     [175][175][175][175]   [158][223] [146]"
  103. 2238 printtab(9)"[158] [146]    [180][154][213][201][170] [180] [170] [180][154][213][201][170]   [158]  [146]"
  104. 2240 printtab(8)"[213][192][180]   [180][154][202][203][170] [180] [170] [180][154][202][203][170]   [170][192][201]"
  105. 2242 printtab(8)"[221] [180]   [183][183][183][183] [180] [170] [183][183][183][183]   [170] [221]"
  106. 2244 printtab(8)"[221] [180]   [205]    [180] [170]    [206]   [170] [221]"
  107. 2246 printtab(8)"[221] [180]   [170]   [206]   [205]   [180]   [170] [221]"
  108. 2248 printtab(8)"[202][192][180]   [170]   [180]   [170]   [180]   [170][192][203]"
  109. 2250 printtab(10)"[205]   [206]   [184][184][184][184][184]   [205]   [206]"
  110. 2252 printtab(11)"[205]     [150][185][185][185][185][185][185][185]     [206]"
  111. 2254 printtab(12)"[205]    [150][205]     [206]    [206]"
  112. 2256 printtab(13)"[205]    [150][183][183][183][183][183]    [206]"
  113. 2258 printtab(14)"[202][192][192]       [192][192][203]
  114. 2260 [153][163]14)"   (NULL)andandandandand(NULL)":nr[178]nr[170]1
  115. 2290 [129]y[178]1[164]1000:[130]y
  116. 2291 n1[178]n1[170]1:[139] n1[177]15 [167] n1[178]0:
  117. 2292 [142]
  118. 3000 [153]"load":[151]53280,0:[151]53281,0
  119. 3001 [139] an$[178]"a" [167] nb$[178]"addition of"
  120. 3002 [139] an$[178]"s" [167] nb$[178]"subtraction of"
  121. 3003 [139] an$[178]"m" [167] nb$[178]"multiply by"
  122. 3004 [139] an$[178]"d" [167] nb$[178]"division by"
  123. 3010 [153]"load  please choose which work you want"
  124. 3015 [139] an$[178]"d" [167] [137] 3020
  125. 3016 [153]" sys w waitopen all digits -- zero through nine"
  126. 3017 [153][163]7)" def 0 wait ";nb$;" zero":[137] 3025
  127. 3020 [153]" sys w waitopen all digits -- one through nine"
  128. 3025 [153][163]7)" def 1 wait ";nb$;" one"
  129. 3026 [153][163]7)" def 2 wait ";nb$;" two"
  130. 3027 [153][163]7)" def 3 wait ";nb$;" three"
  131. 3028 [153][163]7)" def 4 wait ";nb$;" four"
  132. 3029 [153][163]7)" def 5 wait ";nb$;" five"
  133. 3030 [153][163]7)" def 6 wait ";nb$;" six"
  134. 3031 [153][163]7)" def 7 wait ";nb$;" seven"
  135. 3032 [153][163]7)" def 8 wait ";nb$;" eight"
  136. 3033 [153][163]7)" def 9 wait ";nb$;" nine"
  137. 3040 [161] h$:[139] h$[178]"" [167] 3040
  138. 3042 [139] h$[178]"w" [167] [137] 3400
  139. 3044 h[178][197](h$)
  140. 3045 [139] h$[179]"0" [176] h$[177]"9" [167] 3040
  141. 3048 a1[178][181](10[172][187](0)):b1[178]h:
  142. 3050 [139] an$[178]"a" [167] a2[178]a1
  143. 3052 [139] an$[178]"s" [167] a2[178]a1[170]h:
  144. 3054 [139] an$[178]"m" [167] a2[178]a1
  145. 3056 [139] an$[178]"d" [167] a2[178]a1[172]h
  146. 3058 [139] an$[178]"a" [167] d[178]a2[170]h
  147. 3060 [139] an$[178]"s" [167] d[178]a1
  148. 3062 [139] an$[178]"m" [167] d[178]a2[172]h
  149. 3064 [139] an$[178]"d" [167] d[178]a1
  150. 3066 [142]
  151. 3400 a1[178][181](10[172][187](0))
  152. 3401 [139] an$[178]"d" [167] [137] 3403
  153. 3402 b1[178][181](10[172][187](0)):[137] 3405
  154. 3403 b1[178][181](9[172][187](0)[170]1)
  155. 3405 [139] an$[178]"a" [167] a2[178]a1
  156. 3406 [139] an$[178]"m" [167] a2[178]a1
  157. 3407 [139] an$[178]"s" [167] a2[178](a1[170]b1)
  158. 3408 [139] an$[178]"d" [167] a2[178](a1[172]b1)
  159. 3409 [139] an$[178]"a" [167] d[178]a2[170]b1
  160. 3410 [139] an$[178]"m" [167] d[